package com.eastshop.order.vo;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import org.apache.commons.lang3.builder.ToStringBuilder;

import com.eastshop.user.vo.User;
import com.sun.org.apache.bcel.internal.generic.NEW;


/** @author Hibernate CodeGenerator */
public class Order implements Serializable {

    /** identifier field */
    private Integer oid;

    /** nullable persistent field */
    private Double total;

    /** nullable persistent field */
    private Date ordertime;

    /** nullable persistent field */
    private Integer state;

    /** nullable persistent field */
    private String name;

    /** nullable persistent field */
    private String phone;

    /** nullable persistent field */
    private String addr;

    /** persistent field */
    private User user;

    /** persistent field */
    private Set orderitems = new HashSet<Orderitem>();

    /** full constructor */
    public Order(Double total, Date ordertime, Integer state, String name, String phone, String addr, User user, Set orderitems) {
        this.total = total;
        this.ordertime = ordertime;
        this.state = state;
        this.name = name;
        this.phone = phone;
        this.addr = addr;
        this.user = user;
        this.orderitems = orderitems;
    }

    /** default constructor */
    public Order() {
    }

    /** minimal constructor */
    public Order(User user, Set orderitems) {
        this.user = user;
        this.orderitems = orderitems;
    }

    public Integer getOid() {
        return this.oid;
    }

    public void setOid(Integer oid) {
        this.oid = oid;
    }

    public Double getTotal() {
        return this.total;
    }

    public void setTotal(Double total) {
        this.total = total;
    }

    public Date getOrdertime() {
        return this.ordertime;
    }

    public void setOrdertime(Date ordertime) {
        this.ordertime = ordertime;
    }

    public Integer getState() {
        return this.state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return this.phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getAddr() {
        return this.addr;
    }

    public void setAddr(String addr) {
        this.addr = addr;
    }

    public User getUser() {
        return this.user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Set getOrderitems() {
        return this.orderitems;
    }

    public void setOrderitems(Set orderitems) {
        this.orderitems = orderitems;
    }

    public String toString() {
        return new ToStringBuilder(this)
            .append("oid", getOid())
            .toString();
    }

}
